(function() {
    const response =
        {
        "name": "service1",
        "type": "service",
        "className": "m-t",
        "api": "/api/users/search",
        "body": [
            {
                "type": "table",
                "source": "${items}",
                "columns": [
                    {
                        "name": "id",
                        "label": "ID",
                        "type": "text"
                    },
                    {
                        "name": "username",
                        "label": "用户名",
                        "type": "text"
                    },
                    {
                        "name": "name",
                        "label": "昵称",
                        "type": "text"
                    },
                    {
                        "name": "role",
                        "label": "角色",
                        "type": "text"
                    },
                    {
                        "name": "isValid",
                        "label": "激活",
                        "type": "status",
                        "value": "${isValid}"
                    },
                    {
                        "name": "email",
                        "label": "邮箱",
                        "type": "text"
                    },
                    {
                        "name": "lastLoginTime",
                        "label": "上次登录时间",
                        "type": "static-date",
                        "format": "YYYY年MM月DD日 HH时mm分ss秒"
                    },
                    {
                        "name": "isValid",
                        "label": "状态",
                        "type": "mapping",
                        "map": {
                            "1": "<span class='label label-info'>正常</span>",
                            "0": "<span class='label label-danger'>异常</span>",
                            "*": "<span class='label label-success'>其他</span>"
                        }
                    },
                    {
                        "name": "is_valid",
                        "label": "开关",
                        "type": "switch"
                    },
                    {
                        "type": "operation",
                        "label": "操作",
                        "width": 130,
                        "buttons": [
                            {
                                "type": "button",
                                "icon": "fa fa-pencil",
                                "actionType": "dialog",
                                "dialog": {
                                    "title": "编辑",
                                    "actions": [
                                        {
                                            "type": "button",
                                            "actionType": "cancel",
                                            "label": "关闭"
                                        },
                                        {
                                            "type": "submit",
                                            "label": "保存",
                                            "level": "primary"
                                        }
                                    ],
                                    "body": {
                                        "type": "form",
                                        "name": "sample-edit-form",
                                        "api": "/api/users/update",
                                        "body": [
                                            {
                                                "type": "static",
                                                "name": "id",
                                                "label": "ID"
                                            },
                                            {
                                                "type": "static",
                                                "name": "username",
                                                "label": "用户名"
                                            },
                                            {
                                                "type": "divider"
                                            },
                                            {
                                                "type": "input-password",
                                                "name": "password",
                                                "label": "密码",
                                                "required": false
                                            },
                                            {
                                                "type": "input-email",
                                                "name": "email",
                                                "label": "邮箱",
                                                "required": false
                                            },
                                            {
                                                "type": "divider"
                                            },
                                            {
                                                "type": "input-text",
                                                "name": "img_url",
                                                "label": "头像"
                                            }
                                        ]
                                    }
                                }
                            }
                        ],
                        "toggled": true
                    }
                ]
            }
        ]
    }

    window.jsonpCallback && window.jsonpCallback(response);
})();
